package com.amado.course50java8;

public class Java801FunctionalInterfaceDemoTest {
	public static void main(String[] args) {
		//匿名接口
		demoTest("abc",new Java801FunctionalInterfaceDemo() {
			@Override
			public void print() {
				System.out.println("cccc");
			}
		});
		//java8 lambdas静态式只有一行代码
		demoTest("abc",()->System.out.println("cccc"));
		//有多行代码的用{}包围起来
		demoTest("abc",()->{
			System.out.println("abc");
			System.out.println("abc");
			System.out.println("abc");
			System.out.println("abc");
			System.out.println("abc");
			System.out.println("abc");
			System.out.println("abc");
		});
	}
	public static void demoTest (String abc,Java801FunctionalInterfaceDemo demo) {
		demo.print();
	}
}
